package org.sharing.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ManagerSearchAction extends ActionSupport {
	
	String cid;
	String keyword;
	String orderby;
	
	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}


	public String getKeyword() {
		return keyword;
	}


	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}


	public String getOrderby() {
		return orderby;
	}


	public void setOrderby(String orderby) {
		this.orderby = orderby;
	}
	
	String target;

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String execute() throws Exception {
		ActionContext ctx = ActionContext.getContext();
		ctx.getSession().remove("cid");
		if (!getKeyword().trim().equals("")) {
			setKeyword("%" + getKeyword() + "%");
			ctx.getSession().put("cid", getKeyword());
		}
		ctx.getSession().put("cid", getKeyword());
		setTarget("backResultInfo.jsp?type=" + getCid() + "&sequence=" + getOrderby());
		return SUCCESS;
	}
}
